import request from '@/utils/request'
import qs from 'qs'

/* ------------------------------------统计分析------------------------------------- */
export function layerItem(query) {
    return request({
        url:  '/gtyzt/es/search/items',
        method: 'get',
        params: query
    })
}
export function searchResult(data) {
    return request({
        url:  '/gtyzt/es/search/keyword',
        method: 'post',
        data
    })
}
export function queryFilterFields(query) {
    return request({
        url:  '/gtyzt/es/search/queryFieldsControl',
        method: 'get',
        params: query
    })
}
export function statisticsCommon(query) {
    return request({
        url:  '/gtyzt/es/statistics/common',
        method: 'get',
        params: query,
        paramsSerializer: function(params) {
            return qs.stringify(params, { arrayFormat: 'repeat' })
        }
    })
}
// 地图打开统计分析
export function queryItemByServerId(query) {
    return request({
        url:  '/gtyzt/es/statistics/queryItemByServerId',
        method: 'get',
        params: query
    })
}